package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpOperationsSiteAuditSroDetailsPageUtil extends SeleniumPageUtil {
	public final static By OSAS_TAB_CONFIG = By.id("btnTab1");
	public final static By OSAS_TAB_CONTRACT_ITEMS = By.id("btnTab2");
	public final static By OSAS_TAB_NEW_ASSETS = By.id("btnTab3");
	public final static By OSAS_TAB_NOTICES = By.id("btnTab4");
	
	/** elements of config tab(default open tab)*/
	public final static By OSASC_LINK_SAVE = By.id("SiteAuditConfigAjax_btnSaveAjax");
	public final static By OSASC_LINK_RELOAD = By.id("SiteAuditConfigAjax_btnReloadFromMAS");
	public final static By OSASC_LINK_NEXT_LINE = By.id("SiteAuditConfigAjax_btnNextLine");
	public final static By OSASC_LINK_NEXT_DELL_LINE = By.id("SiteAuditConfigAjax_btnNextlineDell");
	public final static By OSASC_LINK_CLEAR = By.id("SiteAuditConfigAjax_btnClear");
	public final static By OSASC_LINK_COPY_THIS_CONFIG = By.id("SiteAuditConfigAjax_btnDuplicate");
	public final static By OSASC_LINK_CREATE_DISCREPANCY = By.id("SiteAuditConfigAjax_btnForceDiscrep");
	public final static By OSASC_INPUT_RENAME_ASSET_NAME = By.id("SiteAuditConfigAjax_txtAssetName_Rename");
	public final static By OSASC_TD_ASSET_NAME = By.xpath("//*[@id='SiteAuditConfigAjax_lblAsset']/table/tbody/tr[7]/td[2]");
	public final static By OSASC_INPUT_SERIAL_NUMBER = By.id("SiteAuditConfigAjax_txtSerialNumber");
	
	public final static By OSASC_SPAN_ASSETS_NOT_FOUND = By.xpath("//*[@id='SiteAudit1_lblCounts']/table/tbody/tr[4]/td[2]/span");

	/** elements of contract items tab*/
	public final static By OSASC_LINK_SAVE_SELECTED = By.id("SiteAuditContractLinesAjax_btnSaveAjax");
	public final static By OSASC_LINK_EXPORT_TO_EXCEL = By.id("SiteAuditContractLinesAjax_lnkExportToExcel");
	public final static By OSASC_LABEL_INCLUDE_CONFLAG = By.xpath("//*[@id='pnlTab2']/table/tbody/tr/td[1]/span[2]/label");
	public final static By OSASC_IMG_FILTER_1 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[2]/div/img[1]");
	public final static By OSASC_IMG_FILTER_2 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[4]/div/img[1]");
	public final static By OSASC_IMG_FILTER_3 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[6]/div/img[1]");
	public final static By OSASC_IMG_FILTER_4 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[7]/div/img[1]");
	public final static By OSASC_IMG_FILTER_5 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[8]/div/img[1]");
	public final static By OSASC_IMG_FILTER_6 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[9]/div/img[1]");
	public final static By OSASC_IMG_FILTER_7 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[10]/div/img[1]");
	public final static By OSASC_IMG_FILTER_8 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[11]/div/img[1]");
	public final static By OSASC_IMG_FILTER_9 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[12]/div/img[1]");
	public final static By OSASC_IMG_FILTER_10 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[13]/div/img[1]");
	public final static By OSASC_IMG_FILTER_11 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[14]/div/img[1]");
	public final static By OSASC_IMG_FILTER_12 = By.xpath("//*[@id='SiteAuditContractLinesAjax_ajaxTblHdr']/tbody/tr[1]/td[15]/div/img[1]");
	
	/** results of click 'Assets Not Found' number*/
	public final static By OSASC_LINK_SERIAL_NUMBER = By.xpath("//*[@id='SiteAuditContractLinesAjax_divajaxTbl']/table/tbody/tr[1]/td[4]/a");
	
	public static void waitForSroDetailsPageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				OSAS_TAB_CONFIG, OSAS_TAB_CONTRACT_ITEMS, OSAS_TAB_NEW_ASSETS, OSAS_TAB_NOTICES, 
				OSASC_LINK_NEXT_LINE, OSASC_LINK_NEXT_DELL_LINE, OSASC_LINK_CLEAR
		});
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSAS_TAB_CONFIG));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSAS_TAB_CONTRACT_ITEMS));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSAS_TAB_NEW_ASSETS));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSAS_TAB_NOTICES));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_LINK_RELOAD));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_LINK_NEXT_LINE));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_LINK_CLEAR));
	}
	
	public static void waitForContractItemsTabToLoad(){
		
		SeleniumUtil.waitOnElements(new By[]{
				OSASC_LINK_SAVE_SELECTED, OSASC_LINK_EXPORT_TO_EXCEL, OSASC_LABEL_INCLUDE_CONFLAG, OSASC_IMG_FILTER_1, OSASC_IMG_FILTER_2,
				OSASC_IMG_FILTER_3, OSASC_IMG_FILTER_4, OSASC_IMG_FILTER_5, OSASC_IMG_FILTER_6, OSASC_IMG_FILTER_7, OSASC_IMG_FILTER_8,
				OSASC_IMG_FILTER_9, OSASC_IMG_FILTER_10, OSASC_IMG_FILTER_11, OSASC_IMG_FILTER_12
		});
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_LINK_SAVE_SELECTED));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_LINK_EXPORT_TO_EXCEL));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_LABEL_INCLUDE_CONFLAG));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_1));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_2));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_3));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_4));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_5));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_6));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_7));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_8));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_9));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_10));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_11));
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(OSASC_IMG_FILTER_12));
		
	}
}
